home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / refex / ex71.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  412 b   |  23 lines

  1. Program Example71;
  2.  
  3. { Program to demonstrate the Truncate function. }
  4.  
  5. Var F : File of longint;
  6.     I,L : Longint;
  7.     
  8. begin
  9.   Assign (F,'test.dat');
  10.   Rewrite (F);
  11.   For I:=1 to 10 Do 
  12.     Write (F,I);
  13.   Writeln ('Filesize before Truncate : ',FileSize(F));
  14.   Close (f);
  15.   Reset (F);
  16.   Repeat
  17.     Read (F,I);
  18.   Until i=5;
  19.   Truncate (F);
  20.   Writeln ('Filesize after Truncate  : ',Filesize(F));
  21.   Close (f);
  22. end.
  23.